package me.zhengjie.sqlservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.mapper.WcsThreeFloorOutboundDetailsHistoryMapper;
import me.zhengjie.pojo.entity.WcsThreeFloorOutboundDetailsHistory;
import me.zhengjie.sqlservice.WcsThreeFloorOutboundDetailsHistoryService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
@RequiredArgsConstructor
public class WcsThreeFloorOutboundDetailsHistoryServiceImpl extends ServiceImpl<WcsThreeFloorOutboundDetailsHistoryMapper, WcsThreeFloorOutboundDetailsHistory> implements WcsThreeFloorOutboundDetailsHistoryService {

    private final WcsThreeFloorOutboundDetailsHistoryMapper wcsThreeFloorOutboundDetailsHistoryMapper;

    @Override
    public boolean insert(WcsThreeFloorOutboundDetailsHistory wcsThreeFloorOutboundDetailsHistory) {
        return wcsThreeFloorOutboundDetailsHistoryMapper.insert(wcsThreeFloorOutboundDetailsHistory) >0;
    }

    @Override
    public List<WcsThreeFloorOutboundDetailsHistory> selectWorkOrder(String workOrder) {
        LambdaQueryWrapper<WcsThreeFloorOutboundDetailsHistory> wcsThreeFloorOutboundDetailsHistoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
        wcsThreeFloorOutboundDetailsHistoryLambdaQueryWrapper.eq(WcsThreeFloorOutboundDetailsHistory::getWorkOrder, workOrder);
        return wcsThreeFloorOutboundDetailsHistoryMapper.selectList(wcsThreeFloorOutboundDetailsHistoryLambdaQueryWrapper);
    }
}
